import { ConstantEnum } from '@libs/common/enums';
import { Inject, Injectable, LoggerService as Logger } from '@nestjs/common';

@Injectable()
export class LoggerService implements Logger {
  constructor(
    @Inject(ConstantEnum.WINSTON_LOGGER_TOKEN) private logger: Logger,
  ) {}

  log(...args: Parameters<Logger['log']>) {
    this.logger.log(...args);
  }

  debug(...args: Parameters<NonNullable<Logger['debug']>>) {
    this.logger.debug?.(...args);
  }

  verbose(...args: Parameters<NonNullable<Logger['verbose']>>) {
    this.logger.verbose?.(...args);
  }

  warn(...args: Parameters<Logger['warn']>) {
    this.logger.warn(...args);
  }

  error(...args: Parameters<Logger['error']>) {
    this.logger.error(...args);
  }
}
